import React from "react";
import ReactDom from "react-dom";
// react-router-dom 的基本使用


// 1.导入组件
import { BrowserRouter as Router,Route,Link } from "react-router-dom";

const App = ()=>(
<Router>
    <div>
        <h1>路由</h1>
        {/* 指定路由入口 */}
        <Link to="/first">页面1</Link>
        {/* 指定路由出口 */}
        <Route path="/first" component={First}></Route>
    </div>
</Router>
)

// 创建First组件
const First = ()=>(
    <p>页面一的内容</p>
)


ReactDom.render(<App></App>,document.getElementById('root'));